package com.linkage.jz.bankruptcy.activity.Project.ZQUser;

import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.linkage.jz.bankruptcy.BankruptcyApp;
import com.linkage.jz.bankruptcy.Consts;
import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.activity.Main.DocTmpListActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerLegalRepActivity;
import com.linkage.jz.bankruptcy.adapter.CommonTabPagerAdapter;
import com.linkage.jz.bankruptcy.bean.MyProInfo;
import com.linkage.jz.bankruptcy.bean.ZQBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserDetailAuthBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserDetailBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserInfo;
import com.linkage.jz.bankruptcy.event.RefreshEvent;
import com.linkage.jz.bankruptcy.fragment.Main.DocTmpGFrgment;
import com.linkage.jz.bankruptcy.fragment.Main.DocTmpZFrgment;
import com.linkage.jz.bankruptcy.fragment.Project.ZQZQUserBaseDetailFragment;
import com.linkage.jz.bankruptcy.fragment.Project.ZQZQUserOperateBaseFragment;
import com.linkage.jz.bankruptcy.fragment.Project.ZQZQUserZQBaseDetailFragment;
import com.linkage.jz.bankruptcy.fragment.Project.ZQZQUserZQBaseShowDetailFragment;
import com.linkage.jz.bankruptcy.net.BaseSubscriber;
import com.linkage.jz.bankruptcy.net.Network;
import com.linkage.jz.bankruptcy.utils.SPUtils;
import com.linkage.jz.bankruptcy.utils.SignUtil;
import com.linkage.jz.bankruptcy.widget.PopupMenuPublicPro;
import com.linkage.jz.bankruptcy.widget.PublicNoticeDialog;
import com.linkage.seapeak.activity.chat.ChatDetailActivity;
import com.linkage.seapeak.activity.project.DissentAddActivity;
import com.linkage.seapeak.activity.register.RegisterActivity;
import com.linkage.seapeak.base.BaseActivity;
import com.linkage.seapeak.utils.CommonUtils;
import com.linkage.seapeak.utils.ToastUtil;
import com.linkage.seapeak.view.QuickPopView;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONObject;

import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


public class ZQUserZQShowDetailActivity extends BaseActivity  {

//    Toolbar toolbar;
//    CollapsingToolbarLayout collapsingToolbar;
//    TabLayout tabLayout;
//    AppBarLayout appbar;
//    ViewPager viewpager;
    private String proid;
    private String pp;
//    TextView tv_proname,tv_managename,tv_manageaddr,tv_manageuser;
    ImageView iv_proimg;

//    private CommonTabPagerAdapter adapter;
    private static String strZQId;
    private static String creditorId;
//    private static String mCreditorRightsId;
    private static ZQUserInfo mInfo;

    private TextView popClick,top_back;
    private TextView tv_user_status, tv_send_notice, tv_online, tv_username, tv_item_bgaswipe_title1, tv_item_bgaswipe_title2, tv_tag1, tv_tag2, tv_tag3;
    private LinearLayout sendmsg;
    private LinearLayout ll_tag, ll_item_bgaswipe_title4;
    private  int page;

    private ViewPager mViewPager;
    private TabPagerAdapter mPagerAdapter;
    ArrayList<Fragment> fragments = new ArrayList<Fragment>();


    public static void start(Context context,ZQUserInfo info) {
        mInfo = info;
        Intent intent = new Intent(context, ZQUserZQShowDetailActivity.class);
        context.startActivity(intent);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
//        getMenuInflater().inflate(R.menu.zq_user_menu_scrolling, menu);
//        return true;
        System.out.println("onPrepareOptionsMenu");
        menu.clear();

//        if(mInfo !=null && mInfogetOpStatus.()!=null)
//        {
//            if(!"0".equalsIgnoreCase(mInfo.getOpStatus()))
//            {
//                getMenuInflater().inflate(R.menu.menu_project_detail_zqr, menu);
//
//            }
//        }
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        if(id == android.R.id.home)
        {
            finish();
        }

        if (id == R.id.menu_ddd) {

            PopupMenuPublicPro popupMenu;
            popupMenu = new PopupMenuPublicPro(this);

//            if (mInfo.getAuth() != null)  else {
                findViewById(R.id.menu_ddd).setVisibility(View.INVISIBLE);
//                return false;
//            }





//            popupMenu.showLocation(R.id.menu_ddd);// 设置弹出菜单弹出的位置
//
//
//            // 设置回调监听，获取点击事件
//            popupMenu.setOnItemClickListener(new PopupMenuPublicPro.OnItemClickListener() {
//
//                @Override
//                public void onClick(PopupMenuPublicPro.MENUITEM item, String str) {}
//            });
        }


        return super.onOptionsItemSelected(item);
    }
    //
    /**
     * 设置屏幕透明度
     * @param alpha
     */
    private void setWindowAlpha(float alpha) {
        WindowManager.LayoutParams lp =getWindow().getAttributes();
//        lp.alpha = alpha; //0.0-1.0
//       getWindow().setAttributes(lp);
    }


    public int Dp2Dx(Context context, float dp) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dp * scale + 0.5f);
    }

    @Override
    protected void onResume() {
        super.onResume();
//        getData(1,creditorId);
    }


    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEventMainThread(RefreshEvent event) {
//        if (TextUtils.equals(event.getType(), RefreshEvent.FLASHZQUSERDETAIL)) {
//            getData(1,creditorId);
//        }
    }

    ImageView iv_phone,iv_email;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //当系统版本为4.4或者4.4以上时可以使用沉浸式状态栏
//        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//            //透明状态栏
//            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//            //透明导航栏
//            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
//        }
        if (getSupportActionBar()!=null){
            getSupportActionBar().hide();
        }
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zquser_show_detail);


         creditorId=mInfo.getId();
//        mCreditorRightsId = getIntent().getStringExtra("creditorRightsId");

//        mInfo=new Gson().fromJson(bookJson,ZQUserInfo.class);
        proid =mInfo.getBankruptcyProjectId();
        page = getIntent().getIntExtra("page",0);
//        getData(1,creditorId);
//        toolbar = (Toolbar) findViewById(R.id.toolbar);
//        setSupportActionBar(toolbar);
//        collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsingToolbar);
//        tabLayout = (TabLayout) findViewById(R.id.tabLayout);
//        appbar = (AppBarLayout) findViewById(R.id.appbar);
//        viewpager = (ViewPager) findViewById(R.id.viewpager);

        sendmsg = findViewById(R.id.sendmsg);
        tv_user_status = (TextView) findViewById(R.id.tv_user_status);
        tv_send_notice = (TextView) findViewById(R.id.tv_send_notice);
        tv_online = (TextView) findViewById(R.id.tv_online);
        tv_username = (TextView)findViewById(R.id.tv_username);

        tv_item_bgaswipe_title1 = findViewById(R.id.tv_item_bgaswipe_title1);
        tv_item_bgaswipe_title2 = findViewById(R.id.tv_item_bgaswipe_title2);
        ll_item_bgaswipe_title4 = findViewById(R.id.ll_item_bgaswipe_title4);

        top_back = findViewById(R.id.top_back);
        top_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        tv_tag1 = findViewById(R.id.tv_tag1);
        tv_tag2 = findViewById(R.id.tv_tag2);
        tv_tag3 = findViewById(R.id.tv_tag3);


        iv_phone= findViewById(R.id.iv_phone);
        iv_email= findViewById(R.id.iv_email);

        iv_phone.setVisibility(View.GONE);
        iv_email.setVisibility(View.GONE);

//        iv_email.setOnClickListener(new View.OnClickListener() {
//
//            @Override
//            public void onClick(View v) {
//                if(mInfo!=null) {
//                    if(mInfo.getAuth()!=null )
//                    {
////                mAuthBaseInfo
//                        if(!mInfo.getAuth().isContactCreditor())
//                        {
//                            com.linkage.jz.bankruptcy.net.ToastUtil.showShort("您没有权限操作");
//                            return;
//                        }
//                    }
//
//                    if (mInfo.getId() != null)
//                        ChatDetailActivity.start(ZQUserZQShowDetailActivity.this, mInfo.getId(),
//                                mInfo.getCreditorName(), mInfo.getBankruptcyProjectId());
//                }
//            }
//        });
//
//        iv_phone.setOnClickListener(new View.OnClickListener() {
//
//            @Override
//            public void onClick(View v) {
//                if(mInfo!=null) {
//
//
//                    if (mInfo != null || !TextUtils.isEmpty(mInfo.getContact())) {
//
//                        if(mInfo.getAuth()!=null )
//                        {
////                mAuthBaseInfo
//                            if(!mInfo.getAuth().isContactCreditor())
//                            {
//                                com.linkage.jz.bankruptcy.net.ToastUtil.showShort("您没有权限操作");
//                                return;
//                            }
//                        }
//                        final String phone = mInfo.getContact();
//                        SetPhone(phone);
//                        noticeDialog = new PublicNoticeDialog(ZQUserZQShowDetailActivity.this, new View.OnClickListener(){
//
//                            @Override
//                            public void onClick(View v) {
//                                switch (v.getId()) {
//                                    case R.id.ll_close:
//                                        noticeDialog.dismiss();
//                                        break;
//                                    case R.id.btn_chancel_notice:
//
//                                        if(checkReadPermission(Manifest.permission.CALL_PHONE,REQUEST_SMS_PERMISSION)){
//
//                                            try {
////                    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(phone));
//
//                                                Intent intent = new Intent(Intent.ACTION_SENDTO);
//                                                Uri data = Uri.parse("smsto:" + phone);
//                                                intent.setData(data);
//                                                startActivity(intent);
//
////                                                Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:"+phoneNumber));
////                                                intent.putExtra("sms_body", message);
////                                                startActivity(intent);
//
//                                            }catch (Exception ex){
//                                                ex.printStackTrace();
//                                            }
//                                        }
//                                        noticeDialog.dismiss();
//                                        break;
//
//                                    case R.id.btn_save_notice:
//                                        if(!"".equalsIgnoreCase(phone)) {
//                                            if(checkReadPermission(Manifest.permission.CALL_PHONE,REQUEST_CALL_PERMISSION)){
//
//                                                try {
////                    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(phone));
//
//                                                    Intent intent = new Intent(Intent.ACTION_CALL);
//                                                    Uri data = Uri.parse("tel:" + phone);
//                                                    intent.setData(data);
//                                                    startActivity(intent);
//                                                }catch (Exception ex){
//                                                    ex.printStackTrace();
//                                                }
//                                            }
//                                        }
//                                        noticeDialog.dismiss();
//
//                                        break;
//                                }
//                            }
//                        }, 2,phone, phone,"发短信","拨打电话");
//                        noticeDialog.show();
//                    } else
//                        showToast("无法获取号码");
//                }
//            }
//        });
        ll_tag = findViewById(R.id.ll_tag);
        init();

//        tv_manageuser = (TextView) findViewById(R.id.tv_manageuser);
//        iv_proimg = (ImageView)findViewById(R.id.iv_proimg);

//        LinearLayout pro_detail_managerterm = (LinearLayout)findViewById(R.id.pro_detail_managerterm);

//        popClick = findViewById(R.id.pop_click);
//        /**
//         * 弹窗
//         */
//        popClick.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                QuickPopView.show(ZQUserZQShowDetailActivity.this);
//            }
//        });
        showData(mInfo);
//        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
//
//        //2.MODE_FIXED模式
////        tabLayout.setTabMode(TabLayout.MODE_FIXED);
//
//
//        setTitle("");
//        collapsingToolbar.setTitle("");
//        collapsingToolbar.setExpandedTitleColor(Color.parseColor("#00ffffff"));//设置还没收缩时状态下字体颜色
//        collapsingToolbar.setCollapsedTitleTextColor(Color.WHITE);//设置收缩后Toolbar上字体的
//        adapter = new CommonTabPagerAdapter(getSupportFragmentManager()
//                , 1, Arrays.asList("基础信息", "债权信息", "操作记录"), this);
//        adapter.setListener(this);
//        viewpager.setAdapter(adapter);
//        tabLayout.setupWithViewPager(viewpager);
//        tabLayout.setTabMode(TabLayout.MODE_FIXED);
//        EventBus.getDefault().register(this);
//        viewpager.setCurrentItem(page);

//        tv_send_notice.setOnClickListener(new View.OnClickListener() {
//
//            @Override
//            public void onClick(View v) {
//                if(mInfo!=null) {
//
//
//
//
//                    if("2".equalsIgnoreCase(mInfo.getIdentityStatus().getValue())) {
//                        noticeDialog = new PublicNoticeDialog(ZQUserZQShowDetailActivity.this, new View.OnClickListener() {
//                            @Override
//                            public void onClick( View view ) {
//                                String  sendStatus = "";
//                                if (view.getId() == R.id.btn_chancel_notice) {//暂存
//
//                                    noticeDialog.dismiss();
//                                } else if (view.getId() == R.id.ll_close) {
//                                    noticeDialog.dismiss();
//                                    return;
//                                } else {//生成
//
//                                    noticeDialog.dismiss();
//                                }
//                                noticeDialog.dismiss();
//
//                            }
//                        }, 5, "原因", mInfo.getAuditInstructions(), "", "确定");
//                        noticeDialog.show();
//                    }
//                }
//            }
//        });

    }
    PublicNoticeDialog noticeDialog;

    private  void showData(ZQUserInfo mInfo)
    {
        if (mInfo != null) {


            if ("5".equalsIgnoreCase(mInfo.getProcessStatus()) || "3".equalsIgnoreCase(mInfo.getProcessStatus()) || "4".equalsIgnoreCase(mInfo.getProcessStatus())) {
                tv_user_status.setVisibility(View.INVISIBLE);
                tv_send_notice.setVisibility(View.INVISIBLE);

                tv_username.setText(mInfo.getCreditorName());
                if ("1".equalsIgnoreCase(mInfo.getOnlineStatus())) {
                    tv_online.setVisibility(View.GONE);


                } else {
                    tv_online.setVisibility(View.VISIBLE);
                    sendmsg.setVisibility(View.VISIBLE);
//                    tv_tag.setVisibility(View.GONE);
//                    tv_item_bgaswipe_title2.setVisibility(View.GONE);
//                    tv_item_bgaswipe_title1.setVisibility(View.GONE);
                    tv_online.setText("线下");
                }

                if ("5".equalsIgnoreCase(mInfo.getProcessStatus())) {
                    ll_tag.setVisibility(View.VISIBLE);
                } else {
                    ll_tag.setVisibility(View.GONE);
                }
                sendmsg.setVisibility(View.GONE);
                tv_item_bgaswipe_title1.setVisibility(View.VISIBLE);
                tv_item_bgaswipe_title2.setVisibility(View.VISIBLE);

                if ("true".equalsIgnoreCase(mInfo.getKindGuarantee())) {
                    tv_tag1.setText("担保优先");
                    tv_tag1.setVisibility(View.VISIBLE);
                    tv_tag1.setBackgroundResource(R.drawable.bg_text_pro_talk_member_tag_dbyx);
                }
                if ("true".equalsIgnoreCase(mInfo.getKindTax())) {
                    tv_tag1.setText("税务");
                    tv_tag1.setVisibility(View.VISIBLE);
                    tv_tag1.setBackgroundResource(R.drawable.bg_text_pro_talk_member_tag_sw);

                }
                if ("true".equalsIgnoreCase(mInfo.getKindOther())) {
                    tv_tag2.setText("其他优先");
                    tv_tag2.setVisibility(View.VISIBLE);
                    tv_tag2.setBackgroundResource(R.drawable.bg_text_pro_talk_member_tag_qtyx);

                }
                if ("true".equalsIgnoreCase(mInfo.getKindOrdinary())) {
                    tv_tag3.setText("普通");
                    tv_tag3.setVisibility(View.VISIBLE);
                    tv_tag3.setBackgroundResource(R.drawable.bg_text_pro_talk_member_tag_pt);
                }
                DecimalFormat decimalFormat = new DecimalFormat("0.00");//构造方法的字符格式这里如果小数不足2位,会以0补足.
                if (mInfo.getAmountDeclared() != null) {

                    float f = Float.parseFloat(mInfo.getAmountDeclared());

                    String p = decimalFormat.format(f);
                    tv_item_bgaswipe_title1.setText("申报金额：" + CommonUtils.resetMoney(mInfo.getAmountDeclared() )+ "元");

                    if (mInfo.getConfirmAmount() != null) {
                        ll_item_bgaswipe_title4.setVisibility(View.VISIBLE);
//                        f = Float.parseFloat(mInfo.getConfirmAmount());
//
//
//                        p = decimalFormat.format(f);

                        tv_item_bgaswipe_title2.setText(CommonUtils.resetMoney(mInfo.getConfirmAmount() )+ "");
                        if (!mInfo.getAmountDeclared().equalsIgnoreCase(mInfo.getConfirmAmount())) {
                            tv_item_bgaswipe_title2.setTextColor(getResources().getColor(R.color.page_top));
                        }
                    } else {
                        ll_item_bgaswipe_title4.setVisibility(View.GONE);
                    }
                } else {
                    tv_item_bgaswipe_title1.setText("");
                }

            } else {

                if ("0".equalsIgnoreCase(mInfo.getOnlineStatus())) {
                    tv_online.setText("线上");
                } else {
                    tv_online.setText("线下");
                }
                tv_username.setText(mInfo.getCreditorName());

                //getSubStatus = 3 未邮寄通知 1未通知 0 已通知
                tv_send_notice.setVisibility(View.INVISIBLE);



            }
//            if (mInfo.getOpStatus() != null) {
//                supportInvalidateOptionsMenu();
//            }
        }
    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        //在界面销毁的地方要解绑
        EventBus.getDefault().unregister(this);
    }
    @Subscribe
    public void getEventBus(MyProInfo info) {
        if (info != null) {
//            mInfo = info;
//            adapter.notifyDataSetChanged();
//            if(mInfo!=null)
//            {
//                tv_proname.setText(mInfo.getProjectName());
//                tv_manageaddr.setText(mInfo.getManagerListStr());
//                tv_manageuser.setText(mInfo.getDebtorLegalRepresentative());
//
//                String url = mInfo.getProjectLogo();
//
//                Glide.with(this).load(url)
//                        .bitmapTransform(new CropCircleTransformation(this))
//                        .placeholder(R.drawable.avatar_defult)
//                        .into(iv_proimg);
//            }
            //这里拿到事件之后吐司一下
            //            Toast.makeText(getActivity(), "num" + num, Toast.LENGTH_SHORT).show();
        }
    }

//    @Override
    public Fragment getFragment(int position) {
        switch (position)
        {
            case 0:
                return ZQZQUserZQBaseShowDetailFragment.newInstance(position, creditorId, proid, "", this);
//                return ZQZQUserBaseDetailFragment.newInstance(position,creditorId,proid);
            case 1:
//                return ZQZQUserZQBaseDetailFragment.newInstance(position, creditorId, proid, mCreditorRightsId, this);
            case 2:
//                return ProZQFragment.newInstance(position,mInfo.getId(),mInfo);
//                break;
                return ZQZQUserOperateBaseFragment.newInstance(position,creditorId,proid);
//
                default:
                    return ZQZQUserOperateBaseFragment.newInstance(position,creditorId,proid);

//
//                    return ProFlowFragment.newInstance(position,mInfo.getId());
//                    break;
        }

    }

    private void init(){
        ZQZQUserZQBaseShowDetailFragment groupChildrenCollect =  ZQZQUserZQBaseShowDetailFragment.newInstance(0, creditorId, proid, "", this);
        ZQZQUserZQBaseShowDetailFragment groupChildrenHasBuy =  ZQZQUserZQBaseShowDetailFragment.newInstance( 1,creditorId, proid, "", this);
        fragments.add(groupChildrenCollect);
        fragments.add(groupChildrenHasBuy);


        mViewPager = (ViewPager) this.findViewById(R.id.id_dcphGroup_viewPager);
        mPagerAdapter = new TabPagerAdapter(this.getSupportFragmentManager(), fragments);

        mViewPager.setAdapter(mPagerAdapter);
        mViewPager.invalidate();
        mPagerAdapter.notifyDataSetChanged();


//        law_searchtxt.setOnEditorActionListener(new TextView.OnEditorActionListener(){
//            @Override
//
//            public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
//
//// TODO Auto-generated method stub
//
//                if(arg1 == EditorInfo.IME_ACTION_SEARCH)
//
//                {
//                    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
//                    if (imm != null) {
//                        imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),0);
//                    }
//
//
//                }
//
//                return false;
//
//            }
//
//        });
    }

    /*
     * 自定义FragmentStatePagerAdapter适配器来显示滑动Fragment
     * */
    private class TabPagerAdapter extends FragmentStatePagerAdapter implements
            ViewPager.OnPageChangeListener {

        private ArrayList<Fragment> objects;

        public TabPagerAdapter(FragmentManager fm, ArrayList<Fragment> objects) {
            super(fm);
            this.objects = objects;
            mViewPager.setOnPageChangeListener(this);
        }

        @Override
        public Fragment getItem(int position) {
            return objects.get(position);
        }

        @Override
        public int getCount() {
            return objects.size();
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }

        @Override
        public void onPageScrolled(int position, float positionOffset,
                                   int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {
            //滑动的监听事件
//            changeFragmentFocus(position);
        }
    }


//    private void changeFragmentFocus(int focus){
//        if(focus == 0){
//            topBtn01.setBackgroundResource(R.drawable.about_b_corner_btn);
//            topBtn02.setBackgroundResource(R.drawable.about_g_corner_btn);
//            topBtn01.setTextColor(getResources().getColor(R.color.white));
//            topBtn02.setTextColor(getResources().getColor(R.color.text_top_color));
//            rl_search1.setVisibility(View.VISIBLE);
//            rl_search2.setVisibility(View.GONE);
//        }else if (focus == 1){
//            rl_search2.setVisibility(View.VISIBLE);
//            rl_search1.setVisibility(View.GONE);
//            topBtn01.setBackgroundResource(R.drawable.about_g_corner_btn);
//            topBtn02.setBackgroundResource(R.drawable.about_b_corner_btn);
//            topBtn01.setTextColor(getResources().getColor(R.color.text_top_color));
//            topBtn02.setTextColor(getResources().getColor(R.color.white));
//        }
//    }





}
